function this_is_a_test(a,b)
	printr(b..":)");
	return a+1, b.."lol";
end

SlashCmdList = {};
SlashCmdList["S"] = function(msg)
	RunScript(msg);
end

SlashCmdList["RANDOM"] = function(msg)
	local num1 = gsub(msg, "(%s*)(%d+)(.*)", "%2", 1);
	local rest = gsub(msg, "(%s*)(%d+)(.*)", "%3", 1);
	local num2 = "";
	local numSubs;
	if ( strlen(rest) > 0 ) then
		num2, numSubs = gsub(msg, "(%s*)(%d+)([-%s]+)(%d+)(.*)", "%4", 1);
			if ( numSubs == 0 ) then
				num2 = "";
			end
	end
	if ( num1 == "" and num2 == "" ) then
		RandomRoll("1", "100");
	elseif ( num2 == "" ) then
		RandomRoll("1", num1);
	else
		RandomRoll(num1, num2);
	end
end

function handle_command(text)
	local command = string.gsub(text, "^(/[^%s]+).*$", '%1') or "";
	local msg = "";
	if ( command ~= text ) then
		msg = string.sub(text, string.len(command) + 2);
	end
	command = string.upper(string.sub(command,2));
	
	if (SlashCmdList[command]) then
		SlashCmdList[command](string.trim(msg));
		return;
	end
	SendChatMessage(text);
	return;
end
